package ex.com.jm.food.entity;

import java.io.Serializable;
/**
 * 小类实体层
 * @author zhaojw
 *
 */







import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="jm_subType")
public class SubType implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="sub_id",nullable=false,unique=true,length=11)
	private Integer subId;//小类id
    @Column(name="sub_name",nullable=false,unique=true,length=32)
	private String subName;//小类名称
    @ManyToOne
    @JoinColumn(name="sup_id")
	private SupType supId;//大类id
    @OneToMany(mappedBy="subId",fetch=FetchType.EAGER)
	private Set<Attr> attrs=new HashSet<Attr>();//属性id
    @Column(name="created",nullable=false,length=32)
	private String created;//小类创建时间
    @Column(name="create_id",nullable=false,length=32)
	private String createId;//小类创建者id
	public Integer getSubId() {
		return subId;
	}
	public void setSubId(Integer subId) {
		this.subId = subId;
	}
	public String getSubName() {
		return subName;
	}
	public void setSubName(String subName) {
		this.subName = subName;
	}
	
	public SupType getSupId() {
		return supId;
	}
	public void setSupId(SupType supId) {
		this.supId = supId;
	}
	public Set<Attr> getAttrs() {
		return attrs;
	}
	public void setAttrs(Set<Attr> attrs) {
		this.attrs = attrs;
	}
	public String getCreated() {
		return created;
	}
	public void setCreated(String created) {
		this.created = created;
	}
	public String getCreateId() {
		return createId;
	}
	public void setCreateId(String createId) {
		this.createId = createId;
	}
	
}
